package rhc.discribute.node.connecter.impl;

import rhc.discribute.BaseComponent;
import rhc.discribute.node.connecter.Connecter;
import rhc.discribute.node.connecter.InnerConnecter;
import rhc.discribute.node.host.Host;
import rhc.discribute.node.sendMessage.SendMessageCallback;

public class ProxyConnecter extends BaseComponent implements Connecter {

	private InnerConnecter innerConnecter;
	
	public ProxyConnecter(InnerConnecter innerConnecter){
		this.innerConnecter=innerConnecter;
	}
	
	@Override
	public void sendMessageToHost(Host host, String message,SendMessageCallback callback,boolean wait) throws Exception {
		innerConnecter.sendMessageToHost(host, message,callback,wait);
	}

	@Override
	public ZKPathLockData tryAcquire(String lockPath) throws Exception {
		return innerConnecter.tryAcquire(lockPath);
	}

	@Override
	public ZKPathLockData tryAcquire(String lockPath, long waitSeconds) throws Exception {
		return innerConnecter.tryAcquire(lockPath, waitSeconds);
	}

	@Override
	public ZKPathLockData acquire(String lockPath) throws Exception {
		return innerConnecter.acquire(lockPath);
	}

	@Override
	public void release(ZKPathLockData lockData) throws Exception {
		innerConnecter.release(lockData);
	}
	
}
